
class FreqToNote
{
public:
	void setFreq(double freq); // Sets the input frequency.
	double getDifference();	   // Returns normalized difference from note, from -10 to 10.
	int getNote();			   // Returns closest note, or 0 if in error.

private:
	double freq_;	// The frequency input from the microphone.
	double diff_;	// How far away the frequency is from the note.
	int note_;		// Integer corresponding to the closest note.
	void computeNote();
	double avg(double a, double b);
};
